//
//  HHHeaderView.m
//  HHgitosc
//
//  Created by hjl on 16/3/22.
//  Copyright © 2016年 hjl. All rights reserved.
//

#import "HHHeaderView.h"
#import <UIImageView+WebCache.h>
#import "HHProject.h"

@interface HHHeaderView ()

@property (weak, nonatomic) IBOutlet UIImageView *iconImage;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UIButton *starButton;
@property (weak, nonatomic) IBOutlet UIButton *watchButton;
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@property (weak, nonatomic) IBOutlet UILabel *time2Label;

@property (weak, nonatomic) IBOutlet UILabel *publicLabel;
@property (weak, nonatomic) IBOutlet UILabel *shareLabel;
@property (weak, nonatomic) IBOutlet UILabel *typeLabel;
@end

@implementation HHHeaderView


- (IBAction)starClick:(id)sender {
}
- (IBAction)watchClick:(id)sender {
}

- (void)awakeFromNib {
    self.autoresizingMask = NO;
    
}

- (void)setProject:(HHProject *)project{
    _project = project;
    
    self.nameLabel.text = project.name;
    [self.iconImage sd_setImageWithURL:[NSURL URLWithString:project.owner.newportrait] placeholderImage:nil];
    self.timeLabel.text = project.created_at;
    
    self.contentLabel.text = project.HHdescription;
    
    [self.starButton setTitle:[NSString stringWithFormat:@"%@ stars", project.stars_count] forState:
        UIControlStateNormal];
    [self.watchButton setTitle:[NSString stringWithFormat:@"%@ watches", project.watches_count] forState:UIControlStateNormal];
    
    self.starButton.titleLabel.text = project.stars_count;
    self.watchButton.titleLabel.text = project.watches_count;
    self.time2Label.text = project.created_at;
    self.publicLabel.text = project.HHpublic;
    self.shareLabel.text = project.forks_count;
    self.typeLabel.text = project.language;
}



@end
